import { Field, ObjectType } from '@nestjs/graphql';
import { Prop, SchemaFactory } from '@nestjs/mongoose';
import { CommonSchema, KeyValueList } from 'src/common/mongodb/commonSchema';
import { Schema } from '@nestjs/mongoose';

@ObjectType()
@Schema({ collection: 'PlayerModelData' })
export class PlayerModelData extends CommonSchema {
  @Field(() => [KeyValueList]!)
  @Prop()
  roles: Map<number, string[]>;

  @Field(() => String!)
  @Prop()
  account?: string;
}

export type PlayerModelDataDocument = PlayerModelData & Document;
export const PlayerModelDataSchema =
  SchemaFactory.createForClass(PlayerModelData);
